1. Technical Field of the Invention
The present invention relates to a memory reduction technique for statistics accumulation and processing. More particularly, the instant invention relates to memory reduction for data storage and processing for histograms used for image processing applications.
2. Description of Related Art
Statistics accumulation and processing is an important step in image processing applications, which perform different modifications on images and video frame. Different primary color combinations such as Red, Green, Blue (RGB) or Cyan, Magenta, Yellow, and Black (CMYK) are used for representing every imaginable color in an image or a video frame. Therefore, considerable memory is required for storing statistics for each pixel in an image or a video frame.
These statistics include a histogram representing for each of the color in RGB or any other color configuration. A histogram is a simple graph that displays distribution of the brightness levels contained in the scene, from the darkest to the brightest. FIG. 1 illustrates an example of a histogram. These values are arrayed across the bottom of the graph from left (darkest) to right (brightest). The vertical axis (the height of points on the graph) shows how much of the image is found at any particular brightness level. Histograms are the basis for numerous spatial domain processing techniques. Histogram manipulation can be used effectively for image enhancement. Information inherent in histograms is quite useful in other image processing applications, such as image compression and segmentation.
The histogram computation is accomplished by counting each distinct pixel value in the image. For 8-bit pixels the size of the array is 256 (0-255). Parse the image and increment each array element corresponding to each pixel processed. This is shown with the help of an example in FIG. 2. The rectangular mosaic pattern on the left contains 40 tiles in a 10×4 grid. These are sorted by color and stacked up accordingly. The higher the pile, the more tiles of that color in the mosaic. The resulting histogram would represent the color distribution of the mosaic. The same has been illustrated with numerical values pixels associated with in FIG. 3. The resulting histogram is shown in FIG. 4.
FIG. 5 illustrates a raster graphics image. A raster graphics image, digital image, or bitmap, is a data file or structure representing a generally rectangular grid of pixels, or points of color, on a computer monitor, paper, or other display device. The color of each pixel is individually defined; images in the RGB color space, for instance, often consist of colored pixels defined by three bytes one byte each for red, green and blue. A colored raster image (or pixmap) will usually have pixels with between one and eight bits for each of the red, green, and blue components. Bayer color filter array is a popular format for digital acquisition of color images. The pattern of the Bayer color filters is shown in FIG. 6. Half of the total number of pixels are green (G), while a quarter of the total number is assigned to both red (R) and blue (B). The Bayer Image data Frame from a sensor is received one pixel per clock, in raster format.
FIG. 7 shows an input image requiring statistics accumulation and processing. An Input image pattern is subdivided into N equally sized blocks. For the purpose of illustration, assume: N is fixed to 16 and all zones are equal in size and juxtaposed, thus leading to a 4×4 grid overlaid on the input image data. FIG. 8 shows the image pattern and the overlaid grid and accumulated histograms. For determining the image quality, the histograms are accumulated for each of the zones in the grid. After the histogram has been accumulated, each bin is read and processed further.
There are several problems associated with such imaging schemes which are used in various imaging and video applications. In video applications, the collected samples of subsequent image frames are entirely independent (except due to similarities between the actual data frames) thus the sample and store hardware does not require (and should not have) any persistent state between image frames. For the video applications, the incoming image frames are continuous and hence, precaution needs to be taken that the stored information is not overwritten before it is processed.
There are three schemes currently used for memory implementations for preventing the data loss in such applications. In the first scheme, an independent memory is used for storing statistical data for each zone. This scheme eliminates data loss, but increases the memory requirement as there is no re-use within one frame. FIG. 9 illustrates the first scheme used for collecting data. In the scheme, sixteen independent Histogram Collection Bins are used, one for each zone, for collecting data for each zone.
Another way could be to reuse bins for different zones by limiting the accumulation to fewer pixels. Instead, the processing is done in the inter-zonal time gap, where no accumulation is being done. This scenario is depicted in FIG. 10. This reduces the memory requirements, as only four bins are used instead of sixteen, but also impacts the accuracy of collected statistics as it is not representative of all the data elements in the zone.
In third scheme, the bins are reused for histogram accumulation. In this scheme, eight bins are used instead of sixteen; hence there is a memory reduction. Also, since there is no reduction in the zone size, there is no associated loss of accuracy as with the second scheme. The BINS numbered 1, 2, 3, and 4 are processed while BINS 5, 6, 7, and 8 are used for accumulation and vice versa. This scenario is depicted in FIG. 11. Although the scheme uses requires less memory bins than the first scheme, it still requires more memory bins for data accumulation when compared to the second scheme. Hence, the scheme has higher memory requirement in comparison to the conventional data accumulation schemes.
Hence, there is a need for a memory reduction technique that does not result in data loss. Also, there is a need for a technique that minimizes the memory requirement for statistics accumulation and processing. There is also need for a data statistics accumulation and processing system which reduces memory requirement and eliminates data loss.